package day08.zuozuo;


    import java.util.Scanner;
    public class zuo012 {
        public static void main(String[] args) {
            //1.键盘录入一个大字符串,再录入一个小字符串
            Scanner sc = new Scanner(System.in);
            System.out.println("输入大字符串");
            String x = sc.next();
            System.out.println("输入小字符串");
            String y = sc.next();
            String[] split = x.split(y);//利用小字符串分割大字符串
            int n = 0;//分割的段落数
            for (int i = 0; i < split.length; i++) {
                n++;
            }
            if(y.length()+x.lastIndexOf(y)==x.length()){
                System.out.println(n);
            }else
                System.out.println(n-1);//输出段落数减1为 出现小字符串的次数

        }
    }

